package com.yuanhua.sim.business.controller;


import com.yuanhua.core.base.R;
import com.yuanhua.sim.business.entity.MsgContent;
import com.yuanhua.sim.business.service.MsgContentService;
import com.yuanhua.sim.business.vo.MsgViewVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 客户端拉取离线消息
 * @author yuanhua
 */
@RestController
@Api(value = "消息控制器")
public class MessageController {

    @Autowired
    private MsgContentService msgContentService;

    @ApiOperation(value = "拉取用户消息", notes = "拉取用户消息")
    @GetMapping("/msg")
    public R<List<MsgViewVO>> getMsg(Long userId, Long otherId){
        //
        List<MsgViewVO> res = msgContentService.getUserMsg(userId, otherId);
        MsgContent byId = msgContentService.getById(1);
        return R.success(res);
    }
}
